﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Xml.Serialization;

namespace Sovigaz.DataProvider
{
    public partial class SovigazDbContext
    {
        public DbSet<IndemnifyProduct> IndemnifyProducts { get; set; }
    }

    [Table("IndemnifyProducts")]
    public class IndemnifyProduct : AuditableEntity
    {
        public IndemnifyProduct()
        {
            Date = DateTime.Now;
            IndemnifyProductLines = new List<IndemnifyProductLine>();
            Status = IndemnifyProductStatus.N.ToString();
        }
        [Key]
        public int IndemnifyProductID { get; set; }

        public string IndemnifyProductCode { get; set; }

        public int PartnerID { get; set; }

        public DateTime Date { get; set; }

        public string Reason { get; set; }

        public string Description { get; set; }

        public string Status { get; set; }

        [XmlIgnore]
        [NotMapped]
        public ICollection<IndemnifyProductLine> IndemnifyProductLines { get; set; }
        
    }

    public class IndemnifyProductComplex
    {
        public int IndemnifyProductID { get; set; }

        public string IndemnifyProductCode { get; set; }

        public int PartnerID { get; set; }

        public string PartnerName { get; set; }

        public int NumberLost { get; set; }

        public int NumberIndemnify { get; set; }

        public DateTime Date { get; set; }

        public string Reason { get; set; }

        public string Description { get; set; }

        public string Status { get; set; }

        public bool IsDeleted { get; set; }

        public string UpdatedName { get; set; }
    }

    public enum IndemnifyProductStatus { N, C }
}